package com.xbongbong.paas.service.impl;

import com.xbongbong.paas.business.rule.FormDataActiveRuleHelp;
import com.xbongbong.paas.pojo.dto.ActiveRuleDTO;
import com.xbongbong.paas.service.ExecuteBusinessRuleService;
import com.xbongbong.paas.toolbox.exception.XbbException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 吴峰
 * @date 2021/10/28 14:24
 */
@Service("executeBusinessRuleService")
public class ExecuteBusinessRuleServiceImpl implements ExecuteBusinessRuleService {

    private static final Logger LOGGER = LoggerFactory.getLogger(ExecuteBusinessRuleServiceImpl.class);

    @Resource
    private FormDataActiveRuleHelp formDataActiveRuleHelp;


    @Override
    public void execute(ActiveRuleDTO activeRuleDTO) throws XbbException {
        try {
            formDataActiveRuleHelp.activeRule(activeRuleDTO);
        } catch (Exception e) {
            LOGGER.error("com.xbongbong.paas.service.impl.ExecuteBusinessRuleServiceImpl.execute error", e);
        }
    }
}
